import 'package:ball_lion/module/overlay/live_float_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ball_lion/resources/colours.dart';
import 'package:ball_lion/utils/utils.dart';
import 'package:ball_lion/module/live/items/live_setting_sheet.dart';
import 'package:ball_lion/widgets/asset_item.dart';

import 'package:ball_lion/routes/routes.dart';

class LiveShareAppend extends StatelessWidget {
  const LiveShareAppend(
      {super.key, required this.liveId, this.fromNormal = true});

  final int liveId;
  final bool fromNormal;

  @override
  Widget build(BuildContext context) {
    TextStyle style = const TextStyle(fontSize: 12, color: Colours.grey99);
    String event = fromNormal ? 'spzb' : 'hpzb';
    return Padding(
      padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
      child: Row(
        children: <Widget>[
          AssetItem(
            asset: "live_float_circle.png",
            name: "小窗播放",
            assetSize: 50,
            textStyle: style,
            onTap: () {
              Utils.onEvent(event, params: {event: 3});
              Get.back(closeOverlays: true);
              LiveFloatController.instance.show();
            },
          ),
          AssetItem(
            asset: "live_setting_circle.png",
            name: "播放设置",
            assetSize: 50,
            textStyle: style,
            onTap: () {
              navigator?.pop();
              Get.bottomSheet(const LiveSettingSheet());
            },
          ),
          AssetItem(
            asset: "report_icon.png",
            name: "举报",
            assetSize: 50,
            textStyle: style,
            onTap: () {
              Get.toNamed(Routes.liveReportChoice, arguments: "直播ID：$liveId");
            },
          )
        ].insertEvery(Container(width: 20)),
      ),
    );
  }
}
